package com.yld.demo2.util;

import com.yld.demo2.service.RedisService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Component;

@SpringBootTest
public class Test_redis {

    @Autowired
    RedisService redisService;

    @Test
    public void test() {
        redisService.set("testkey", "Hello world");
        Object value = redisService.get("testkey");
        System.out.println("value = " + value);

    }
}
